home *** CD-ROM | disk | FTP | other *** search
- #ifndef _DTJOBJCT11_HPP
- #define _DTJOBJCT11_HPP
-
- #include "dtobject.hpp"
- #include "dtformbs.hpp"
-
- #define JAVA_FILE_EXTENSION WTEXT(".java")
- #define JAVA_CLASS_EXTENSION WTEXT(".class")
-
- struct MMJCodeGenerationParms;
-
- class METAEXPORTCLASSDEF DTJObjectBase11 : public DTObjectBase
- /************************************************************/
- {
- public:
- virtual ~DTJObjectBase11();
-
- virtual WJavaObject* GetWJavaObject() const;
-
- // Returns the WJavaObject used by the form painter at
- // design time, if such an object exists.
- // Returns NULL otherwise.
- virtual WJavaObject * GetJImplementation() const;
-
- virtual WBool GetIsHollow(); // groupbox
-
- virtual WBool GetImplements( const WString & ) const;
-
- virtual void GenFileFragment( MMFileFragment fg, WStringList &,
- MMFileGenerationParms * parms ) const;
-
- // not used any more
- void GenCode( MMCodeGeneration mmCodeGen,
- WStringList& srcList ) const;
-
- WBool DoJavaPainting() const;
-
- void SetNonImplementationJavaObj( WJavaObject * javaObj );
-
- virtual WBool CanCreateNonImplementationJavaObj() const;
-
- static PropertyInspectObject * MakePropEditor_dataSource(
- const MMProperty * prop, PropertyInspector * prt,
- WUInt numObject, DTObject ** objects );
-
- static PropertyInspectObject * MakePropEditor_dataColumns(
- const MMProperty * prop, PropertyInspector * prt,
- WUInt numObject, DTObject ** objects );
-
- public:
-
- // override this to demangle the Meta object name
- virtual void GenClassName( WString & ) const;
-
- //
- // Style
- //
- // The Windows style property of the associated Window.
- // This doesn't necessarily match GetWindow()->GetStyle()
- // because some styles are deferred until run-time (such
- // as WSVisible).
-
- virtual WStyle GetStyle() const;
- virtual WBool SetStyle( WStyle stl, WBool clone=FALSE );
-
- //
- // DefaultStyle
- //
- // The style with which new instances are created. Default
- // implementation returns GetWindow()->GetDefaultStyle().
-
- virtual WStyle GetDefaultStyle() const;
-
- //
- // ExtendedStyle
- //
- // The ExtendedStyle property of the window nature.
-
- virtual WStyle GetExtendedStyle() const;
- virtual WBool SetExtendedStyle( WStyle style, WBool clone=FALSE );
-
- //
- // DefaultExtendedStyle
- //
- // See DefaultStyle
-
- virtual WStyle GetDefaultExtendedStyle() const;
-
-
- //
- // Visible
- //
- // The object is currently visible.
-
- virtual WBool GetVisible();
- virtual WBool SetVisible( WBool visible );
-
- //
- // Create
- //
- // Call Create on the windowed object.
- //
- virtual WBool Create( WWindow * parent, const WRect & r,
- const WChar * text, WStyle style,
- WStyle exStyle, void * data = NULL,
- WBool isLoading = FALSE );
- //
- // Rectangle
- //
- // The pixel-based position of the object; optionally, absolute
- // to the desktop.
-
- virtual void DTGetRectangle( WRect & r,
- WBool abs = FALSE ) const;
- virtual void DTSetRectangle( const WRect & r,
- WBool abs = FALSE );
- virtual WRect DTGetDURectangle( WBool abs = FALSE ) const;
-
- //
- // ClientRectangle
- //
- // Get the client rectangle. This is mainly used for DTForms.
-
- virtual void DTGetClientRectangle( WRect & r ) const;
-
- //
- // RCRectangle
- //
- // The rectangle to use in the .rc file (still in pixel though).
- // This differs for WComboBox, which gives a .rc file rectangle
- // of the correct height instead of the design time height.
-
- virtual void DTGetRCRectangle( WRect & r ) const;
-
- //
- // PixelsToDLU / DLUToPixels
- //
- // Map between pixels and dialog units (DLU).
-
- virtual WRect DTMapPixelsToDLU( const WRect & pix ) const;
- virtual WRect DTMapDLUToPixels( const WRect & dlu ) const;
-
- //
- // BringToTop
- //
- // Bring the object to the top of the Z- order
-
- virtual void DTBringToTop();
-
- //
- // Repaint
- //
- // Invalidate an object and cause it to be repainted
-
- virtual void DTRepaint( WRect * rect=NULL );
-
-
- //
- // ObjectPrefix
- //
- // Get the prefix used when accessing member functions of the
- // object -- eg. "cb_1->"
-
- virtual WString GetObjectPrefix() const;
-
- //
- // IsValidContainer
- //
- // Returns true if obj is allowed as a container for this
- // DTObject. errMsg is filled in with details about
- // about why it isn't allowed.
- virtual WBool IsValidContainer(
- const DTObject *obj,
- WString &errMsg ) const;
-
- virtual void AmendPopup( WPopupMenu * popup, WBool before );
-
- WBool HandleCustomizeMenuClick( WObject *, WEventData * );
-
- virtual void GenerateCode( MMCodeGeneration mmCodeGen,
- ostream& src,
- MMCodeGenerationParms& pGenParms );
-
- virtual void EmitProperties( const WString& objPrefix,
- ostream& src ) const;
-
- virtual void EmitProperty( const WString& objPrefix, ostream& src,
- const MMProperty * prop ) const;
-
- virtual WString DTGetName() const;
-
- virtual void GenName( WUInt id, WString & ) const;
-
- virtual void PropertyChanged( const WString & name );
-
- virtual void AddEventsToList( DTUserFunctionVect* pEventList,
- WBool recurseChildren );
-
- virtual void GenEventObjectName( WString & ) const;
-
- WBool PreventUpdates();
- WBool AllowUpdates();
-
- void SetSerializableLevelOne( WBool on ) { ( on ) ? (_serializableLevelOne = 1) : (_serializableLevelOne = -1); }
- WBool GetSerializableLevelOne() const { return ( _serializableLevelOne == 1 ); }
- WBool GetSerializableLevelOneValid() const { return ( _serializableLevelOne != 0 ); }
- void SetSerializableLevelTwo( WBool on ) { ( on ) ? (_serializableLevelTwo = 1) : (_serializableLevelTwo = -1); }
- WBool GetSerializableLevelTwo() const { return ( _serializableLevelTwo == 1 ); }
- WBool GetSerializableLevelTwoValid() const { return ( _serializableLevelTwo != 0 ); }
-
- //
- // FDX
- //
-
- virtual WBool GetDDXEnabled() const;
- virtual void SetDDXEnabled( WBool );
-
- virtual void EscapeCString( WString &, const WString & ) const;
-
- protected:
- virtual void GenerateCreate( const WString& objPrefix,
- ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
- virtual void GeneratePreAdd( const WString& objPrefix,
- ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
- virtual void GenerateImports( ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
-
- virtual void GenerateEvents( ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
-
- virtual void GenerateAddListenerCode( const WString prefix,
- ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
-
- virtual void GenerateCreateEvent( const WString& objPrefix,
- ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
-
- virtual void GenerateDestroyEvent( const WString& objPrefix,
- ostream& src,
- MMJCodeGenerationParms* pGenParms ) const;
-
- virtual WStyle CheckExtraStyles(WStyle style);
-
- WString GetLastPart( const WString &fulltype ) const;
-
- virtual WString GetControlScope() const;
-
- private:
- WBool handleObjectLoading( WObject *, WEventData * );
-
- protected:
- DTJObjectBase11( const MetaObject * pMetaObj = NULL );
-
- WBool _doJavaPainting;
- WMenuItem * _customizeMenuItem;
- WRect _latestDTRect;
- WJavaObject * _customizer;
- WJavaObject * _customizerForm;
- WJavaObject * _nonImplementationJavaObj;
- WInt _allowUpdates;
- WInt _serializableLevelOne;
- WInt _serializableLevelTwo;
- };
-
- class METAEXPORTCLASSDEF DTJObject11 : public DTJObjectBase11
- /***********************************************************/
- {
- public:
- virtual ~DTJObject11();
-
- static PropertyInspectObject *
- MakePropEditor_SerializationData( const MMProperty * prop,
- PropertyInspector * prt,
- WUInt numObject, DTObject ** objects );
-
- protected:
- DTJObject11( const MetaObject * pMetaObj = NULL );
- };
-
- // needed for mdreader
- typedef DTJObject11 DTjava__dot__lang__dot__Object__dot__11;
- typedef DTJObjectBase11 DTpowersoft__dot__generic__dot__Object__dot__11;
-
- class MMProperty;
- class PropertyInspectObject;
- class PropertyInspector;
-
- extern PropertyInspectObject * METAEXPORTDEF PropertyJavaCustomEditorIObj_0_Make_11( const MMProperty * prop, PropertyInspector * prt, WUInt n, DTObject ** o );
- extern PropertyInspectObject * METAEXPORTDEF PropertyJavaCustomEditorIObj_1_Make_11( const MMProperty * prop, PropertyInspector * prt, WUInt n, DTObject ** o );
- extern PropertyInspectObject * METAEXPORTDEF PropertyJavaCustomEditorIObj_2_Make_11( const MMProperty * prop, PropertyInspector * prt, WUInt n, DTObject ** o );
-
- #endif // _DTJOBJCT11_HPP
-